package com.boarsoft.boar.entity;

import com.boarsoft.common.Util;

/**
 * 服务对象
 * 
 * @author Mac_J
 *
 */
public class SvcInfo {
	public static final short STATUS_NOUSE = 0;
	public static final short STATUS_INUSE = 1;

	public static final short TYPE_SRVC = 0;
	public static final short TYPE_FLOW = 1;
	
	public static final short STATUS_DISABLE = 0;
	public static final short STATUS_ENABLE = 1;

	/** 服务ID */
	private String id;
	/** 服务编号 */
	private String code;
	/** 服务名称 */
	private String name;
	/** 接口ID */
	private String faceId;
	/** 实现类 */
	private String impl;
	/** 实现类的版本 */
	private String ver;
	/** 状态 */
	private short status = STATUS_INUSE;
	/** 是普通服务还是有流程的服务 */
	private short type = TYPE_FLOW;
	/** 访问路径 */
	private String url;
	/** 导出路径 */
	private String path;
	/** 服务描述 */
	private String memo;
	/** 引用接口 */
	private FaceInfo face;

	// ------------------

	@Override
	public boolean equals(Object o) {
		if (o == null || !(o instanceof SvcInfo)) {
			return false;
		}
		SvcInfo a = (SvcInfo) o;
		if (a.code == null || this.code == null || Util.strIsEmpty(a.code)
				|| Util.strIsEmpty(this.code)) {
			return false;
		}
		return a.code.equals(this.code);
	}

	public SvcInfo() {
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFaceId() {
		return faceId;
	}

	public void setFaceId(String faceId) {
		this.faceId = faceId;
	}

	public String getVer() {
		return ver;
	}

	public void setVer(String ver) {
		this.ver = ver;
	}

	public String getImpl() {
		return impl;
	}

	public void setImpl(String impl) {
		this.impl = impl;
	}

	public short getStatus() {
		return status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public short getType() {
		return type;
	}

	public void setType(short type) {
		this.type = type;
	}

	public FaceInfo getFace() {
		return face;
	}

	public void setFace(FaceInfo face) {
		this.face = face;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
}